/*
 *  Copyright 2023 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../variables.less';

.rjsf.no-header #root__title,
.rjsf.no-header #root__description,
.rjsf .form-additional .control-label,
.rjsf .panel.panel-danger.errors .panel-heading {
  display: none;
}

.rjsf .form-group.field {
  margin: 12px 0;
}

.rjsf .property-wrapper.additional-fields ~ .button-comp {
  margin-top: 6px;
}

.rjsf .control-label {
  text-transform: capitalize;
  line-height: 2;
}

.rjsf .control-label .required {
  margin-left: 2px;
  color: @failed-color;
}

.rjsf .field-description {
  color: @text-grey-muted;
  font-size: 12px;
  line-height: 16px;
  margin: 2px;
}

.rjsf .form-control {
  width: 100%;
  padding: 4px 8px;
  color: @text-color;
  border-radius: 4px;
  border: @global-border;

  &:hover {
    border: 1px solid @grey-3;
  }

  &:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border: 1px solid @primary-color;
  }
}

.rjsf .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  vertical-align: bottom;
  cursor: pointer;
  line-height: 20px;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: @white;
  transition-duration: 150ms;
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
  border-radius: 20px;

  &:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
  }
}

.rjsf .btn.btn-block {
  width: 100%;
}

.rjsf .btn.array-item-remove {
  padding: 14px;
  background: url()
    center center no-repeat;
  background-size: 50%;
}

.rjsf .row {
  display: flex;
  align-items: center;
  width: 100%;
  margin: -6px;
}

.rjsf .col-xs-5 {
  flex: 1 1 0%;
  padding: 6px;
}

.rjsf .col-xs-2 {
  width: 28px;
  padding: 6px;
}

.rjsf .errors .list-group > .list-group-item {
  list-style-type: disc;
}

.rjsf .panel-danger.errors {
  margin-top: 8px;
  margin-bottom: 0;
}

.rjsf .list-group {
  padding: 20px;
}

.rjsf .list-group-item {
  list-style-type: disc;
}

.rjsf .checkbox input[type='checkbox'] {
  margin-right: 4px;
  cursor: pointer;
  accent-color: @primary-color;
}

.rjsf .has-error input {
  border-color: @error-color !important;
}
